package cn.admin.remoting;

import java.util.List;
import java.util.Map;

public interface ConnectionFactory {

    List<String> groups();

    int connectionCountInGroup(String group);

    boolean addConnectionToGroup(Connection connection, String group);

    boolean removeConnectionFromGroup(Connection connection, String groupName);

    List<Connection> groupConnectionSnapshot(String groupName);

    List<Connection> allConnectionSnapshot();

    void addListener(IOEventListener listener);

    void removeListener(IOEventListener listener);

    void registerProcessor(RequestProcessor<?> processor);

    void replaceProcessor(RequestProcessor<?> processor);

    <T> RequestProcessor<T> removeProcessor(Class<T> appRequestClazz);

    <T> RequestProcessor<T> findProcessor(Class<T> appRequestClazz);

    Map<Class<?>, RequestProcessor<?>> getProcessors();

}
